package com.zrlh.file_trans_monitor.stater;

import com.zrlh.file_trans_monitor.service.FileMonitorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.net.InetAddress;

@Component
@Order(1)
@Slf4j
public class ApplicationStarter implements ApplicationRunner {
    @Autowired
    private FileMonitorService fileMonitorService;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        fileMonitorService.initTask();
        fileMonitorService.writeCSV();
    }
}
